﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ElectronicShoppingMall.Service.Services.Enterprise;
using ElectronicShoppingMall.Web.Back.DTOS;
using System.IdentityModel.Tokens;
using System.Text;
using System.Runtime.Serialization.Json;
using System.IO;

namespace ElectronicShoppingMall.Web.Back.Controllers
{
    public class HomeController : Controller
    {
        private EmployeeUserService _service = new EmployeeUserService();
        // GET: Home
        public ActionResult Index()
        {
            return View();
        }

         public ActionResult Admin()
        {
            return View("Login");
        }

        public ActionResult ActivateEmployee(int employeeId,string activateCode)
        {
            try
            {
                _service.ActivateEmployee(employeeId, activateCode);
                return RedirectToAction("Admin");
            }
            catch
            {
                return View("Error");
            }
        }
    }
}